home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / ATLK / TN.ATLK.004 < prev    next >
Encoding:
Text File  |  1990-09-21  |  7.3 KB  |  154 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6. AppleTalk
  7. #4:    Printing Through the Firmware
  8.  
  9. Revised by:    Jim Luther                                      September 1990
  10. Written by:    Matt Deatherage & Jim Luther                         July 1989
  11.  
  12. This Technical Note discusses considerations of printing through the 
  13. AppleTalk Remote Print Manager (RPM) interface from ProDOS 8 applications.
  14. Changes since March 1990:  Revised code sample to simplify finding the 
  15. transparent network printing slot with the ROM 03 Apple IIgs.  Please note 
  16. that the method of finding the transparent network printing slot shown in the 
  17. March 1990 revision of this Note does work correctly, the new method is just 
  18. simpler.  In addition, revised the wording of the Note to clarify that 
  19. transparent network printing is the RPM interface.
  20. _____________________________________________________________________________
  21.  
  22. The AppleShare Programmer's Guide to the Apple IIgs stated that the Remote 
  23. Print Manager (RPM) interface allowed transparent network printing through 
  24. Super Serial Card entry points in slot 7.  This statement is pretty short-
  25. sighted.  It's much like saying printing to an ImageWriter II is initiated 
  26. when you do a PR#1 command--it's only true if what you want is where you think 
  27. it is--and usually it isn't.
  28.  
  29. Note:  The AppleShare Programmer's Guide to the Apple IIgs has been 
  30.        superseded by the AppleShare Programmer's Guide to the Apple II 
  31.        Family.
  32.  
  33. An Apple IIe Workstation Card, although recommended for slot 7, can work in 
  34. almost any slot (just like an ImageWriter II with a Super Serial Card can be 
  35. connected to nearly any slot, except maybe slot 3 when the 80-column firmware 
  36. is active).  An Apple IIgs with ROM versions 00 or 01 may only have the 
  37. firmware used by the RPM interface in slot 7.  An Apple IIgs with ROM version 
  38. 03 may only have the firmware used by the RPM interface in either slot 1 or 2.
  39.  
  40. Before printing through the RPM interface slot, take the same precautions you 
  41. would take before printing to any slot--check to make sure you see the 
  42. requested slot is a Pascal device before using Pascal entry points, and try to 
  43. look for the signature bytes that indicate the features you want are present.  
  44. In general, avoid hard-coding slot numbers for anything.
  45.  
  46. ProDOS 8 applications which offer network printing through the RPM interface 
  47. should give users the choice of printing to any of the seven slots as well as 
  48. the Network Printer.  When Network Printer is selected, the application can 
  49. find the slot used by the RPM interface by using the 6502 code sample included 
  50. in this Note.  Allowing the selection of Network Printer is especially 
  51. important for applications that keep a configuration file containing a user's 
  52. default printer setup.  If an application keeps only the slot number in the 
  53. configuration file, users may need to change the printer selection often if 
  54. they print from several different machines.
  55.  
  56. Warning:  Printing to a slot with no firmware generally results in a crash.
  57.  
  58. The code sample uses two methods to determine the slot the RPM interface is 
  59. using.  The first method works with the Apple IIe Workstation card and the ROM 
  60. 01 Apple IIgs.  It looks at the AppleTalk completion routine address returned 
  61. by the AppleTalk GetInfo call, and if that address is in the slot ROM space, 
  62. then that slot is the slot used by the RPM interface.  In other words, if the 
  63. completion routine points to $0000CnXX, where n is between 1 and 7, then n is 
  64. the slot to be used when printing through the RPM interface.  If the 
  65. completion routine address is not in the slot ROM space, then the application 
  66. cannot determine what slot the RPM interface is using and must query the user.  
  67. The second method works only with the ROM 03 Apple IIgs.  It retrieves the 
  68. slot the RPM interface is using from location $E101C2.
  69.  
  70. This technique applies only to ProDOS 8 programs.  Apple IIgs applications 
  71. running under GS/OS should do text printing over the network through the 
  72. Remote Print Manager (.RPM) driver, which can be identified by a deviceID of 
  73. $001F as returned from the DInfo call.
  74.  
  75. ;
  76. ; This routine will identify AppleTalk and the RPM interface slot 
  77. ; (if possible).
  78. ; This routine is for ProDOS 8 applications only.
  79. ;
  80.                     keep FindRPMSlot
  81.                     longa off
  82.                     longi off
  83.  
  84. FindRPMSlot         start
  85.                     lda #$00
  86.                     sta RPMSlot         default to no RPM interface slot
  87.  
  88. ; Check for AppleTalk (see AppleTalk Technical Note #1)
  89.  
  90.                     jsr $BF00           ProDOS 8 MLI
  91.                     dc  h'42'           $42 command for network calls
  92.                     dc  a'InfoParams'   Parameter list address
  93.                     bcs NoATalk         no AppleTalk; handle the error
  94.  
  95. ; Get machine type & ROM version (see Apple II Miscellaneous Tech Note #7)
  96.  
  97.                     sec
  98.                     jsr $FE1F           What kind of machine are we on?
  99.                     bcs CheckCom        Not a IIGS, check completion address
  100.                     cpy #$03
  101.                     bcc CheckCom        Earlier than ROM 03 IIGS, check
  102. ;                                         completion address
  103.  
  104. ROM03               anop                ROM 03 or greater IIGS' use location 
  105. ;                                       $E101C2 to find the RPM interface slot
  106.                     lda $E101C2         Get the RPM interface slot
  107.                     sta RPMSlot
  108.  
  109.                     beq AskForSlot
  110.                     bra HaveSlot
  111.  
  112. CheckCom            anop                use completion address to find slot
  113.                     lda ComReturn+2     bank $00?
  114.                     ora ComReturn+3     high byte = 0?
  115.                     bne AskForSlot      no, so slot can't be determined
  116.                     lda ComReturn+1     get the address page
  117.                     cmp #$C8
  118.                     bcs AskForSlot      greater or equal to $C8 is bad
  119.                     cmp #$C1
  120.                     bcc AskForSlot      less than $C1 is bad
  121.                     and #$0F            $Cn = $0n
  122.                     sta RPMSlot
  123.  
  124. HaveSlot            anop                AppleTalk is installed and RPM is 
  125. ;                                         using slot #RPMSlot
  126.  
  127. AskForSlot          anop                AppleTalk is installed but RPM 
  128.  ;                                        interface slot cannot be determined
  129.  
  130. NoATalk             anop                AppleTalk is not installed
  131.  
  132.                     rts                 so this sample returns
  133.  
  134. RPMSlot             entry
  135.                     dc  h'00'           Slot RPM interface is using
  136.  
  137. InfoParams          dc  h'00'           Synchronous only
  138.                     dc  h'02'           GetInfo call number
  139.                     ds  2               result code
  140. ComReturn           ds  4               completion return address
  141.                     ds  8               space for other result info
  142.  
  143.                     end
  144.  
  145.  
  146. Further Reference
  147. _____________________________________________________________________________
  148.   o  AppleShare Programmer's Guide for the Apple II Family
  149.   o  Apple II AppleTalk Technical Note #1, Identifying AppleTalk
  150.   o  Apple II Miscellaneous Technical Note #7, Apple II Family Identification
  151.   o  Apple II Miscellaneous Technical Note #8, Pascal 1.1 
  152.      Identification Bytes
  153.  
  154.